package com.czk.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.czk.pojo.User;
import com.czk.service.ConsumerService;
import com.czk.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author:ChenZhangKun
 * @Date: 2021/3/23 14:12
 */
@RestController
public class ConsumerController {
    @Autowired
    private ConsumerService consumerService;

    @GetMapping("/init/{username}")
    public User getUserByName(@PathVariable("username") String username) {
        return consumerService.getUserByName(username);
    }
}
